home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / tex-k / lucida-1.2.tar.gz / lucida-1.2.tar / lucida-1.2 / psnfss.sup < prev    next >
Text File  |  1992-08-22  |  8KB  |  248 lines

  1. \def\filedate{18.8.92}%
  2. \def\filename{psnfss.sup}%
  3. \def\fileversion{PSNFSS 2.2.5}%
  4. % Sebastian Rahtz,
  5. % 12 Cygnet Street
  6. % York Y02 1AG
  7. % spqr@minster.york.ac.uk
  8. \newif\if@loud@psnfss
  9. \@loud@psnfssfalse % make true to get loading messages
  10. \immediate\write\sixt@@n{\filename, \fileversion <\filedate> (SPQR)}%
  11. \immediate\write\sixt@@n{PostScript additions to NFSS}%
  12. % This is the main addition to the NFSS commands, which is normally
  13. % loaded into a format, but can also be included by style files for other
  14. % formats. It defines some commands needed to load PostScript fonts
  15. %
  16. % Left to itself, the NFSS restricts a number of commands
  17. % to the preamble only. I want to be able to load fonts anywhere
  18. % in the document, so I take a copy now before the NFSS disables them!
  19. %
  20. \let\late@extra@def=\extra@def
  21. \let\late@subst@fontshape=\subst@fontshape
  22. \let\late@new@fontshape=\new@fontshape
  23. %%
  24. %% Generalized scheme for PostScript fonts, assuming they
  25. %% all have the same basic structure. What method of scaling is used
  26. %% is determined by \scaling@type (see below)
  27. %%-----------------------------------------------------------
  28. %% Some of these macros adapted from npsfonts.sty by Timothy van Zandt
  29. %%-----------------------------------------------------------
  30. %%
  31. %% An optional first argument to \declare@font scales the font
  32. %% parameters
  33. % 1 - scaling factor
  34. % 2 - name of font family
  35. % 3 - series
  36. % 4 - style
  37. % 5 - fontname
  38. \def\declare@font{%
  39.   \@ifnextchar [{\declare@@font}{\declare@@font[1]}}%
  40. %
  41. \def\declare@@font[#1]#2#3#4#5%
  42. {\scaling@type{#1}%
  43. \late@new@fontshape{#2}{#3}{#4}{\scaled@sizes{#5}}{}}%
  44. %
  45. \def\font@scale#1#2#3{\dimen@=#2\dimen@=#3\dimen@
  46.   \edef\scaled@sizes##1{\scaled@sizes{##1}<#1>##1 at\the\dimen@ }}%
  47. %
  48. % recommended by Y&Y for their Lucida Bright distribution
  49. %
  50. \def\scale@lucidasizes#1{%
  51.   \edef\scaled@sizes##1{}%
  52.   \font@scale{5}{5.2pt}{#1}%
  53.   \font@scale{6}{6.1pt}{#1}%
  54.   \font@scale{7}{6.9pt}{#1}%
  55.   \font@scale{8}{7.8pt}{#1}%
  56.   \font@scale{9}{8.6pt}{#1}%
  57.   \font@scale{10}{9.5pt}{#1}%
  58.   \font@scale{11}{10.4pt}{#1}%
  59.   \font@scale{12}{11.2pt}{#1}%
  60.   \font@scale{14}{12.9pt}{#1}%
  61.   \font@scale{17}{15.5pt}{#1}%
  62.   \font@scale{20}{18.1pt}{#1}%
  63.   \font@scale{25}{22.4pt}{#1}%
  64.   \font@scale{29}{29.86pt}{#1}%
  65.   \font@scale{34}{35.83pt}{#1}%
  66.   \font@scale{41}{41.28pt}{#1}}%
  67. %
  68. % normal PS fonts. open to discussion
  69. \def\scale@stdsizes#1{%
  70.   \edef\scaled@sizes##1{}%
  71.   \font@scale{5}{5pt}{#1}%
  72.   \font@scale{6}{6pt}{#1}%
  73.   \font@scale{7}{7pt}{#1}%
  74.   \font@scale{8}{8pt}{#1}%
  75.   \font@scale{9}{9pt}{#1}%
  76.   \font@scale{10}{10pt}{#1}%
  77.   \font@scale{11}{10.95pt}{#1}%
  78.   \font@scale{12}{12pt}{#1}%
  79.   \font@scale{14}{14.4pt}{#1}%
  80.   \font@scale{17}{17.28pt}{#1}%
  81.   \font@scale{20}{20.74pt}{#1}%
  82.   \font@scale{25}{24.88pt}{#1}%
  83.   \font@scale{29}{29.86pt}{#1}%
  84.   \font@scale{34}{35.83pt}{#1}%
  85.   \font@scale{41}{41.28pt}{#1}}%
  86. %%
  87. %% An optional first argument to
  88. %% \postscript@font scales the font
  89. \def\postscript@fontdef{%
  90.   \@ifnextchar [{\postscript@font}{\postscript@font[1]}}%
  91. %%
  92. \def\postscript@font[#1]#2#3#4#5#6#7#8#9{%
  93. \expandafter\ifx\csname l@d#3\endcsname\relax
  94. % 2 : full name for family
  95. % 3 : short name for family
  96. % 4 : tfm name for normal font
  97. % 5 : tfm name for italic font
  98. % 6 : tfm name for boldfont
  99. % 7 : tfm name for bolditalic font
  100. % 8 : tfm name for smallcaps font
  101. % 9 : tfm name for slanted font
  102. \if@loud@psnfss
  103. \immediate\write\sixt@@n
  104.   {*** Defining fonts for PostScript #2 family at scale #1}%
  105. %\immediate\write\sixt@@n
  106. % {#3 as shortname}%
  107. %\immediate\write\sixt@@n
  108. % {#4 as TFM name for normal font}%
  109. %\immediate\write\sixt@@n
  110. % {#5 as TFM name for italic font}%
  111. %\immediate\write\sixt@@n
  112. %  {#6 as TFM name for bold font}%
  113. %\immediate\write\sixt@@n
  114. %  {#7 as TFM name for bolditalic font}%
  115. %\immediate\write\sixt@@n
  116. %  {#8 as TFM name for smallcaps font}%
  117. %\immediate\write\sixt@@n
  118. %  {#9 as TFM name for slanted font}%
  119. %
  120. \fi
  121. \declare@font[#1]{#3}{m}{n}{#4}%
  122. \declare@font[#1]{#3}{m}{it}{#5}%
  123. \declare@font[#1]{#3}{bx}{n}{#6}%
  124. \declare@font[#1]{#3}{bx}{it}{#7}%
  125. \declare@font[#1]{#3}{m}{sc}{#8}%
  126. \declare@font[#1]{#3}{m}{sl}{#9}%
  127. \late@extra@def{#3}{}{}%
  128. %
  129. % bold and bold-extended regarded as the same
  130. % slanted and smallcaps only in normal font
  131. \late@subst@fontshape{#3}{b}{sc}{#3}{m}{sc}%
  132. \late@subst@fontshape{#3}{b}{sl}{#3}{m}{sl}%
  133. \late@subst@fontshape{#3}{bx}{sc}{#3}{m}{sc}%
  134. \late@subst@fontshape{#3}{bx}{sl}{#3}{m}{sl}%
  135. \late@subst@fontshape{#3}{b}{n}{#3}{bx}{n}%
  136. \late@subst@fontshape{#3}{b}{it}{#3}{bx}{it}%
  137. %
  138. % there are a number of changes to make,
  139. % and additions, to get the best use out of the PS fonts
  140. %
  141. \expandafter\let\csname l@d#3\endcsname\@empty
  142. \chardef\pounds='243
  143. \def\H##1{{\accent"CD ##1}}
  144. \def\.##1{{\accent"C7 ##1}}
  145. % borrowd this from Tom Rokicki
  146. \newdimen\aadimen
  147. \def\AA{\leavevmode\setbox0\hbox{h}\aadimen\ht0
  148.   \advance\aadimen-1ex\setbox0\hbox{A}\rlap{\raise.67\aadimen
  149.   \hbox to \wd0{\hss\char'27\hss}}A}
  150. \def\aa{\char'227}%
  151. \chardef\cent="0A2
  152. \chardef\yen="0A5
  153. \chardef\currency="0A8
  154. \chardef\quotesingle="0A9
  155. \chardef\guillemotleft="0AB
  156. \chardef\guilsinglleft="0AC
  157. \chardef\guilsinglright="0AD
  158. \chardef\quotesinglbase="0B8
  159. \chardef\quotedblbase="0B9
  160. \chardef\guillemotright="0BB
  161. \else
  162. \if@loud@psnfss
  163. \immediate\write\sixt@@n
  164.   {Family #3 already set up}%
  165. \fi
  166. \fi
  167. }%
  168. \let\scaling@type\scale@stdsizes
  169. %%
  170. %%% now the user interface
  171. %% the user types something like \romanfont{times}%
  172. %% -- if the command sequence \load@times is defined, it is executed
  173. %-------------------------------------------------------------
  174. \def\romanfont#1{%
  175. \expandafter\ifx\csname load@#1\endcsname\relax
  176. \typeout{**** ERROR!!! font family #1 UNKNOWN ****}%
  177. \else
  178. \csname load@#1\endcsname
  179. \renewcommand{\rmdefault}{#1}\rm
  180. \if@loud@psnfss
  181. \typeout{Default roman typeface now #1}%
  182. \fi
  183. \fi}%
  184. \def\sansfont#1{%
  185. \expandafter\ifx\csname load@#1\endcsname\relax
  186. \typeout{**** ERROR!!! font family #1 UNKNOWN ****}%
  187. \else
  188. \csname load@#1\endcsname
  189. \renewcommand{\sfdefault}{#1}\rm
  190. \if@loud@psnfss
  191. \typeout{Default sans-serif typeface now #1}%
  192. \fi
  193. \fi}%
  194. \def\typewriterfont#1{%
  195. \expandafter\ifx\csname load@#1\endcsname\relax
  196. \typeout{**** ERROR!!! font family #1 UNKNOWN ****}%
  197. \else
  198. \csname load@#1\endcsname
  199. \renewcommand{\ttdefault}{#1}\rm
  200. \if@loud@psnfss
  201. \typeout{Default typewriter typeface now #1}%
  202. \fi
  203. \fi}%
  204. %-------------------------------------------------------------
  205. %%% 
  206. %%% some dummies for CMR
  207. \def\load@cmr{}%
  208. \def\load@cmss{}%
  209. \def\load@cmtt{}%
  210. %%% see times.sty, palatino.sty etc for example definitions of loading
  211. %%% Times, Palatino, Avantgarde, Bookman, NCS, Courier and Helvetica
  212. %%% etc, using the Karl Berry names for Adobe fonts,
  213. %%% USING VIRTUAL FONTS TO MIMIC CMR LAYOUT! (Not DC).
  214. %%% An example is:
  215. %-----------------------------------------
  216. %% \def\load@courier{%
  217. %% \postscript@fontdef{Courier}{courier}%
  218. %% {pcrr}{pcrro}{pcrb}{pcrbo}{pcrr}{pcrr}%
  219. %% }%
  220. %% \def\load@helvetica{%
  221. %% \postscript@fontdef{Helvetica}{helvetica}%
  222. %% {phvr}{phvro}{phvb}{phvbo}{phvrc}{phvro}%
  223. %% }%
  224. %% \def\load@times{%
  225. %% \postscript@fontdef{Times}{times}%
  226. %% {ptmr}{ptmri}{ptmb}{ptmbi}{ptmrc}{ptmro}%
  227. %% }%
  228. %% %
  229. %% \romanfont{times}%
  230. %% \sansfont{helvetica}%
  231. %% \typewriterfont{courier}%
  232. %% 
  233. %% some useful hacks....
  234. %%
  235. \newcount\driver@setup
  236. \driver@setup=3
  237. %  a little something for LaTeX to make colour.sty work
  238. \def\visible{}
  239. \newif\if@visible\@visibletrue
  240. %
  241. % a tool from Van Zandt for showing x-height of a font
  242. %
  243. \def\showxheight#1{%
  244.   \font\@tempfont=#1 at 10pt%
  245.   \typeout{^^J x-height of #1 at 10pt is \the\fontdimen5\@tempfont}}
  246. %
  247. \endinput
  248.